#ifndef THINK_THINK_EXCEPTION_THROWABLEERROR_H
#define THINK_THINK_EXCEPTION_THROWABLEERROR_H

static char* think_exception_throwableerror =
	"\n"
	"// +----------------------------------------------------------------------\n"
	"// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]\n"
	"// +----------------------------------------------------------------------\n"
	"// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.\n"
	"// +----------------------------------------------------------------------\n"
	"// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )\n"
	"// +----------------------------------------------------------------------\n"
	"// | Author: yunwuxin <448901948@qq.com>\n"
	"// +----------------------------------------------------------------------\n"
	"\n"
	"namespace think\\exception;\n"
	"\n"
	"class ThrowableError extends \\ErrorException\n"
	"{\n"
	"    public function __construct(\\Throwable $e)\n"
	"    {\n"
	"\n"
	"        if ($e instanceof \\ParseError) {\n"
	"            $message  = \'Parse error: \' . $e->getMessage();\n"
	"            $severity = E_PARSE;\n"
	"        } elseif ($e instanceof \\TypeError) {\n"
	"            $message  = \'Type error: \' . $e->getMessage();\n"
	"            $severity = E_RECOVERABLE_ERROR;\n"
	"        } else {\n"
	"            $message  = \'Fatal error: \' . $e->getMessage();\n"
	"            $severity = E_ERROR;\n"
	"        }\n"
	"\n"
	"        parent::__construct(\n"
	"            $message,\n"
	"            $e->getCode(),\n"
	"            $severity,\n"
	"            $e->getFile(),\n"
	"            $e->getLine()\n"
	"        );\n"
	"\n"
	"        $this->setTrace($e->getTrace());\n"
	"    }\n"
	"\n"
	"    protected function setTrace($trace)\n"
	"    {\n"
	"        $traceReflector = new \\ReflectionProperty(\'Exception\', \'trace\');\n"
	"        $traceReflector->setAccessible(true);\n"
	"        $traceReflector->setValue($this, $trace);\n"
	"    }\n"
	"}\n"
	"\n"
;
#endif